<ul class="subNavig">
    <li><a href="{$data.root}?input=list_of_clients">Clients</a></li>
    <li><a href="{$data.root}?input=list_of_users">Users</a></li>
    <li><a href="{$data.root}?input=list_of_tariffs">Tariffs</a></li>
    <li><a href="{$data.root}?input=fixed_expense">Fixed expenses</a></li>
</ul>
{include $data.pathToError}
<script type="text/javascript">
    {literal}
        
    $(document).ready(function() {
        $(".float").change(function() {
            makeFloat(".float");
        });
    });
    {/literal}
</script>
<h2 class="pageTitle">Add client</h2>

<form class="adding" action="{$data.root}?input=add_client" method="post" onsubmit="return checkAdd_client(
                                                                    $('#name').val(),
                                                                    $('input:radio[name=client[active]]:checked').val())
                                                                    ">
    <table class="tableForm">
        <tr>
            <td>
                <label for="name">Name <span class="red">*</span> </label>
            </td>
            <td>
                <input name="client[name]" id="name" type="text" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="fullName">Full name<span class="red"></span> </label>
            </td>
            <td>
                <input name="client[fullName]" id="fullName" type="text" size="50" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="ico">ICO<span class="red"></span> </label>
            </td>
            <td>
                <input name="client[ICO]" id="ico" type="text" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="icdph">ICDPH<span class="red"></span> </label>
            </td>
            <td>
                <input name="client[ICDPH]" id="icdph" type="text" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="address">Address<span class="red"></span> </label>
            </td>
            <td>
                <input name="client[address]" id="address" type="text" size="50" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="city">City<span class="red"></span> </label>
            </td>
            <td>
                <input name="client[city]" id="city" type="text" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="zip">ZIP<span class="red"></span> </label>
            </td>
            <td>
                <input name="client[zip]" id="zip" type="text" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="typeOfCooperation">Type of cooperation<span class="red"></span> </label>
            </td>
            <td>
                <select name="client[typeOfCooperation]" size="1" id="typeOfCooperation">
                    {foreach $data.typesOfCoop as $key => $type}
                        <option value="{$type.id}">{$type.type}</option>
                    {/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <label for="conditions">Terms<span class="red"></span> </label>
            </td>
            <td>
                <textarea cols="50" rows="8" id="conditions" name="client[conditions]"></textarea>
            </td>
        </tr>
        <tr>
            <td>
                <label for="monthlyPrepaid">Prepaid monthly range<span class="red"></span> </label>
            </td>
            <td>
                <input class="float" name="client[monthlyPrepaid]" id="monthlyPrepaid" type="text" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="monthlyFee">Monthly fee<span class="red"></span> </label>
            </td>
            <td>
                <input class="float" name="client[monthlyFee]" id="monthlyFee" type="text" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="contactPerson">Contact person<span class="red"></span> </label>
            </td>
            <td>
                <select name="client[contactPerson]" size="1" id="contactPerson">
                    <option value="NULL">Please select</option>
                    {foreach $data.contactPersons as $key => $person}
                        <option value="{$person.users_id}">{$person.surname}, {$person.name}</option>
                    {/foreach}
                </select>
            </td>
        </tr>
        <tr>
            <td>
                <label for="ip">IP<span class="red"></span> </label>
            </td>
            <td>
                <input name="client[ip]" type="text" value="" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="active">Active<span class="red">*</span> </label>
            </td>
            <td>
                <input name="client[active]" type="radio" value="0" checked="checked" /> Yes <br/>
                <input name="client[active]" type="radio" value="1" /> No
            </td>
        </tr>
        <tr>
            <td>
                <label for="bad_payer">Bad payer<span class="red"></span> </label>
            </td>
            <td>
                <input name="client[bad_payer]" type="hidden" value="0" /> 
                <input name="client[bad_payer]" type="checkbox" value="1" />
            </td>
        </tr>
        <tr>
            <td>
                <label for="domain">Domain<span class="red"></span> </label>
            </td>
            <td>
                @<input name="client[domain]" type="text" value="" id="domain" /> 
            </td>
        </tr>
        <tr class="submitRow">
            <td>
                <input name="action" value="add_client" type="hidden" />
            </td>
            <td>
                <input type="submit" value="Add client" name="add_client" /> &nbsp; 
                <span class="red">* Required</span>
            </td>
            <td></td>
        </tr>
    </table>
</form>